package model;

import java.util.ArrayList;

/**
 * @author Hazal
 *
 */
public class Resource {
	
	private Integer resourceId;
	private String name= null;
	private ArrayList<Task> oTaskList = new ArrayList<Task>();
	
	
	public Resource (Integer resId,String name){
		this.resourceId= resId;
		this.name=name;
	}
	
	public Resource(){
		
	}

	public Integer getResourceId() {
		return resourceId;
	}

	public void setResourceId(Integer resId) {
		try {
			if (resId >= 0){
				this.resourceId = resId;
			}
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
	

	public String getName() {
		return name;
	}

	public void setName(String name) {
		try {
			 if (!(name.equals(""))){
				 this.name = name;
			}
			
		} catch (NullPointerException e) {
				System.out.println("Please enter a valid description!"+e.getMessage());
				
		}
		this.name = name;
	}
	
	public ArrayList<Task> getoTaskList() {
		return oTaskList;
	}

	public void setoTaskList(ArrayList<Task> oTaskList) {
		this.oTaskList = oTaskList;
	}


	@Override
	public String toString() {
		return "Resource [id=" + resourceId + "]";
	}

	@Override
	public boolean equals(Object arg0) {
		// TODO Auto-generated method stub
		return super.equals(arg0);
	}
	
	

}
